feat(experimentation): enable rollout override on experiment start [WIP]#7870
Closed
gagantrivedi wants to merge 1 commit into
Closed
feat(experimentation): enable rollout override on experiment start [WIP]#7870gagantrivedi wants to merge 1 commit into
gagantrivedi wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7870 +/- ##
==========================================
- Coverage 98.61% 98.56% -0.06%
==========================================
Files 1484 1487 +3
Lines 58287 58446 +159
==========================================
+ Hits 57481 57605 +124
- Misses 806 841 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Starting an experiment now enables its rollout segment override so it serves its split to traffic. transition_experiment_status enables the override when moving to RUNNING, re-applying the existing override via update_flag with enabled=True (value/allocations preserved). No-op when the experiment has no rollout or the override is already enabled.
e9a15f2 to
ec2772b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to
Warning
WIP — opening early for visibility/feedback.
Follow-up to #7851 / #7858. Until now, the rollout segment override created with an experiment went live as soon as it was configured (it took
spec.enabledat rollout time), andstartonly flipped the experiment's status. This wires the two together: starting an experiment enables its rollout segment override so it actually serves its split to traffic.transition_experiment_statusenables the rollout override when moving toRUNNING, inside the existing transaction.enable_experiment_rollout(experiment, request)service reads the current rollout via the mergedget_experiment_rollout()(which already reassemblesenabled/feature_state_value/multivariate_feature_state_valuesthe v1/v2-aware way), then re-applies it throughupdate_flagwithenabled=True. The value is taken from the fetched representation viaExperimentRolloutSerializer.to_spec; multivariate allocations are omitted soupdate_flagpreserves them. No new value-reconstruction logic and no changes to shared versioning code.Pause/complete are intentionally left untouched for now (start path only).
How did you test this code?
Unit tests (all green locally) +
mypy,ruff,flagsmith-lint-tests, anddocgen events(no catalogue diff).update_flagwrite).POST .../experiments/{id}/start/flips the rollout segment override'senabledtotrueend-to-end (for both session-user and master-API-key auth).tests/unit/experimentation/suite passes (411) — no regression.